package net.roobook.auth.properties;

import net.roobook.auth.configure.RoobookValidateCodeProperties;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;

/**
 * @Author Roobook
 * @description Auth相关的配置类
 * @date 2022/4/8
 */
@SpringBootConfiguration
@PropertySource(value = {"classpath:roobook-auth.properties"})
@ConfigurationProperties(prefix = "roobook.auth")
public class RoobookAuthProperties {
    private RoobookClientsProperties[] clients = {};
    private int accessTokenValiditySeconds = 60 * 60 * 24;
    private int refreshTokenValiditySeconds = 60 * 60 * 24 * 7;
    //验证码配置类
    private RoobookValidateCodeProperties code = new RoobookValidateCodeProperties();

    // 免认证路径
    private String anonUrl;
    public RoobookClientsProperties[] getClients() {
        return clients;
    }

    public void setClients(RoobookClientsProperties[] clients) {
        this.clients = clients;
    }

    public int getAccessTokenValiditySeconds() {
        return accessTokenValiditySeconds;
    }

    public void setAccessTokenValiditySeconds(int accessTokenValiditySeconds) {
        this.accessTokenValiditySeconds = accessTokenValiditySeconds;
    }

    public int getRefreshTokenValiditySeconds() {
        return refreshTokenValiditySeconds;
    }

    public void setRefreshTokenValiditySeconds(int refreshTokenValiditySeconds) {
        this.refreshTokenValiditySeconds = refreshTokenValiditySeconds;
    }

    public RoobookValidateCodeProperties getCode() {
        return code;
    }

    public void setCode(RoobookValidateCodeProperties code) {
        this.code = code;
    }

    public String getAnonUrl() {
        return anonUrl;
    }

    public void setAnonUrl(String anonUrl) {
        this.anonUrl = anonUrl;
    }
}
